<?php
namespace app\test\controller;
use think\Controller;
use think\Db;
use diyclass\Rabdno;

class Index extends Controller
{
    public function index()
    {
        //return '我是测试页面';
        //$user="小明";
        /*$this->assign('username',$user);
        return $this->fetch('index');*/
        //$this->success("注册成功！","/test/index/info");
        //$this->error("验证码错误！","/test/index/info");
        //$this->redirect('/test/index/info');
        //return $this->info();
        //dump($user);
        //$user=Db::name('character')->select();
        //dump($user);
       /* $data = [
            ['ch_name' => '巴基'],
            ['ch_name' => '女帝']
        ];
        Db::name('character')->insertAll($data);*/
        /*Db::name('character')
            ->where('ch_id',10)
            ->update(['ch_state' => 0]);*/
        /*Db::name('character')
            ->where('ch_id',11)
            ->delete();*/

        /*$user=Db::name('character')
            ->where('ch_id','<>',1)
            ->where('ch_state',1)
            ->select();*/
        /*$user=Db::name('character')
            ->alias('a')
            ->join('group b','a.ch_gid = b.gr_id')
            ->select();

        dump($user);*/

        /*$usercount=Db::name('character')
            ->sum('ch_state');
        return $usercount;*/
        /*$this->assign('ch_id',1);*/
        /*$user=Db::name('character')->select();
        $this->assign('user',$user);*/
        /*$hyuser=Db::connect('huoyingDb')
            ->table("huo_user")
            ->select();
        dump($hyuser);*/

        $randc=new Rabdno();
        $number=$randc->GetRandStr(9);
        echo $number;

        return $this->fetch();

    }

    public function info()
    {
        return "跳转成功！";
    }
}
